package com.sai.sql;

public class SqlUsuario {
    public static final String SELECT_1;
    public static final String SELECT_2;
    public static final String SELECT_MALUMNO;
    public static final String SELECT_MPROFESOR;
    public static final String UPDATE_ALUMNO;
    public static final String UPDATE_PROFESOR;

    static {
        StringBuilder qryBuilder = new StringBuilder();
        qryBuilder.append("SELECT idAlumno, Nombre, ApellidoPaterno, Matricula FROM alumno WHERE Matricula = ? AND Contrasena = ?");
        SELECT_1 = qryBuilder.toString();
        
        qryBuilder = new StringBuilder();
        qryBuilder.append("SELECT idProfesor, Nombre, ApellidoPaterno, Matricula, TipoUser FROM profesor WHERE Matricula = ? AND Contrasena = ?");
        SELECT_2 = qryBuilder.toString();
        
        qryBuilder = new StringBuilder();
        qryBuilder.append("SELECT Contrasena FROM alumno WHERE Matricula = ?");
        SELECT_MALUMNO = qryBuilder.toString();
        
        qryBuilder = new StringBuilder();
        qryBuilder.append("SELECT Contrasena FROM profesor WHERE Matricula = ?");
        SELECT_MPROFESOR = qryBuilder.toString();
        
        qryBuilder = new StringBuilder();
        qryBuilder.append("UPDATE alumno set Contrasena = ? WHERE Matricula = ?");
        UPDATE_ALUMNO = qryBuilder.toString();
        
        qryBuilder = new StringBuilder();
        qryBuilder.append("UPDATE profesor set Contrasena = ? WHERE Matricula = ?");
        UPDATE_PROFESOR = qryBuilder.toString();
    }
}
